let layer,$;
layui.use(['layer','jquery'],function () {
    layer=layui.layer,$=layui.jquery;
    $('#login').click(function () {
        let username=$('#username').val();
        let password=$('#password').val();
        //console.log("username=%s,password=%s",username,password);
        //定义固定盐
        //将输入的明文密码与固定盐进行混淆
        //针对混淆后的密码进行MD5加密
        let user={
            username:username,
            password:password
        }
        $.post('user/userLogin',user,function (data) {
            if(data.code==200){
                layer.msg("登入成功",{icon:6},function () {
                    if(data.data=="0"){
                        location.href="input/admin/index";
                    }else{
                        location.href="input/ordinary/index";
                    }
                });
            }else{
                layer.msg(data.msg,function () {});
            }

        },'json');
    });
})